package com.dragon.modules.yuegou.query.merchant;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.merchant.AdviceEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;
/**
 * 商户建议表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-05-08 10:58:38
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class AdviceQuery extends AdviceEntity implements Query<AdviceEntity> {

	private static final long serialVersionUID = 1L;


    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 商圈ID查询条件 */
	@JsonUnwrapped(prefix = "busdId")
	private Condition<String> busdIdCondition;

    /** 商户ID查询条件 */
	@JsonUnwrapped(prefix = "merchantId")
	private Condition<String> merchantIdCondition;

    /** 建议内容查询条件 */
	@JsonUnwrapped(prefix = "content")
	private Condition<String> contentCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "createTime")
	private Condition<LocalDateTime> createTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public AdviceQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public AdviceQuery(AdviceEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public AdviceQuery(AdviceQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.busdIdCondition != null) {
			this.busdIdCondition = other.busdIdCondition.copy();
		}
		if(other.merchantIdCondition != null) {
			this.merchantIdCondition = other.merchantIdCondition.copy();
		}
		if(other.contentCondition != null) {
			this.contentCondition = other.contentCondition.copy();
		}
		if(other.createTimeCondition != null) {
			this.createTimeCondition = other.createTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<AdviceEntity> toQueryWrapper() {
		QueryWrapper<AdviceEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (busdIdCondition != null) {
			busdIdCondition.toWrapper(wrapper, COL_BUSD_ID);
		}
		if (merchantIdCondition != null) {
			merchantIdCondition.toWrapper(wrapper, COL_MERCHANT_ID);
		}
		if (contentCondition != null) {
			contentCondition.toWrapper(wrapper, COL_CONTENT);
		}
		if (createTimeCondition != null) {
			createTimeCondition.toWrapper(wrapper, COL_CREATE_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回商圈ID查询条件
	 * 
	 * @return busdIdCondition 商圈ID查询条件
	 */
	public Condition<String> busdId() {
		this.busdIdCondition = new Condition<>();
		return this.busdIdCondition;
	}
	
	/**
	 * 获取商圈ID查询条件
	 * 
	 * @return busdIdCondition 商圈ID查询条件
	 */
	public Condition<String> getBusdIdCondition() {
		return busdIdCondition;
	}

	/**
	 * 设置商圈ID查询条件
	 * 
	 * @param busdIdCondition 商圈ID查询条件
	 */
	public void setBusdIdCondition(Condition<String> busdIdCondition) {
		this.busdIdCondition = busdIdCondition;
	}

	/**
	 * 构造并返回商户ID查询条件
	 * 
	 * @return merchantIdCondition 商户ID查询条件
	 */
	public Condition<String> merchantId() {
		this.merchantIdCondition = new Condition<>();
		return this.merchantIdCondition;
	}
	
	/**
	 * 获取商户ID查询条件
	 * 
	 * @return merchantIdCondition 商户ID查询条件
	 */
	public Condition<String> getMerchantIdCondition() {
		return merchantIdCondition;
	}

	/**
	 * 设置商户ID查询条件
	 * 
	 * @param merchantIdCondition 商户ID查询条件
	 */
	public void setMerchantIdCondition(Condition<String> merchantIdCondition) {
		this.merchantIdCondition = merchantIdCondition;
	}

	/**
	 * 构造并返回建议内容查询条件
	 * 
	 * @return contentCondition 建议内容查询条件
	 */
	public Condition<String> content() {
		this.contentCondition = new Condition<>();
		return this.contentCondition;
	}
	
	/**
	 * 获取建议内容查询条件
	 * 
	 * @return contentCondition 建议内容查询条件
	 */
	public Condition<String> getContentCondition() {
		return contentCondition;
	}

	/**
	 * 设置建议内容查询条件
	 * 
	 * @param contentCondition 建议内容查询条件
	 */
	public void setContentCondition(Condition<String> contentCondition) {
		this.contentCondition = contentCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return createTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> createTime() {
		this.createTimeCondition = new Condition<>();
		return this.createTimeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return createTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> getCreateTimeCondition() {
		return createTimeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param createTimeCondition 查询条件
	 */
	public void setCreateTimeCondition(Condition<LocalDateTime> createTimeCondition) {
		this.createTimeCondition = createTimeCondition;
	}

}
